import HomeView from "@/views/Home/index.vue"
import LoginView from "@/views/Login/index.vue"
import NotFound from "@/views/NotFound/index.vue"

import HomeDefaultView from "@/views/Home/Layout/index.vue"

import AdminView from "@/views/Home/Admin/index.vue"
import AdminListView from "@/views/Home/Admin/AdminList/index.vue"
import AdminAddView from "@/views/Home/Admin/AdminAdd/index.vue"

import ProductListView from "@/views/Home/Product/ProductList/index.vue"
import ProductManageView from "@/views/Home/Product/ProductManage/index.vue"

import BannerListView from "@/views/Home/Banner/BannerList/index.vue"
import BannerShowView from "@/views/Home/Banner/BannerShow/index.vue"


export default [
    // 一级视图  
    {
      path: '/',
      name: 'home',
      component: HomeView,
      // 二级视图  => 渲染在 / 路由下的router-view的二级视图
      children:[{
        // 主页面 二级视图默认显示内容
        path: '',
        redirect:"/home",
      },{
        path: '/home',
        name: 'default',
        component: HomeDefaultView
      },{
        path:"/admin",
        name:"admin",
        redirect:"/admin/list",
        // component: AdminView,  (!!! 如果此处设置component => children中的内容就是三级视图,如果不设置children中的内容就是二级视图)

        // 三级视图
        children:[{
            path: '/admin/list',   // 在二级视图中展示
            name: 'admin-list',
            component: AdminListView
          },{
            path: '/admin/add',
            name: 'admin-add',
            component: AdminAddView
         }]
      },{
        path:"/product/list",
        name:"product-list",
        component:ProductListView
      },{
        path:"/product/manage",
        name:"product-manage",
        component:ProductManageView
      },{
        path:"/banner/list",
        name:"banner-list",
        component:BannerListView
      },{
        path:"/banner/show",
        name:"banner-show",
        component:BannerShowView
      },{
        path:"/order/list",
        name:"order-list",
        component:BannerListView
      },{
        path:"/order/manage",
        name:"order-manage",
        component:BannerShowView
      }],
    },
    {
      path: '/login',
      name: 'login',
      component: LoginView
    },
    {
      path: '/404',
      name: 'not-found',
      component: NotFound
    },
    {
      path:"/:pathMatch(.*)*",
      redirect:"/404",
    }

  ]


  /* 
    menu = [{path:"/admin",name:"admin",children:[]}]
  
  
  
  */